package org.jeecg.modules.manage.utils;

import lombok.extern.slf4j.Slf4j;
import org.apache.commons.text.StringSubstitutor;

import java.util.HashMap;
import java.util.Map;

/**
 * Freemarker模板工具类
 */
@Slf4j
public class FreemarkerUtil {


    public static void main(String[] args) throws Exception {
        String emailTempl="你好，我是${userName},很高兴见到你！";

        Map<String,String> replaceMap = new HashMap<String,String>();
        replaceMap.put("userName","皮卡丘");
        replaceMap.put("nickName","哈哈哈");

        String sendContent= new StringSubstitutor(replaceMap).replace(emailTempl);

        System.out.println(sendContent);

    }

}
